package gbench.appdemo.medicine.chemistry.particle;

import java.util.*;
import java.util.function.Function;
import java.util.stream.*;

/**
 * 离子
 * 
 * @author gbench
 *
 */
public class Ion extends Particle {

    public Ion(String name, int charge) {
        super(name);
        this.charge = charge;
    }

    public static Function<Integer, List<Ion>> of(String... names) {
        return charge -> {
            return Arrays.stream(names).map(name -> new Ion(name, charge)).collect(Collectors.toList());
        };
    }

    public static Ion of(String name, int charge) {
        return new Ion(name, charge);
    }

}
